package cn.wit.summit.chwan.models.dto;

import com.google.gson.Gson;

import java.io.Serializable;
import java.util.List;

import cn.wit.summit.chwan.models.db.DownLoadTaskTable;
import cn.wit.summit.chwan.models.response.IndexBeanV3Response;
import cn.wit.summit.chwan.tools.downloadtool.DownLoadStatusConfig;

/**
 * Created by pengsk on 2018/4/13.
 */

public class GameListBaseBean implements Serializable{
    /**
     * game_id : 3866803292
     * game_name : 像素车：超改-国内唯一正版
     * game_ico : http://ctimg.5fun.com/upload/images/bd/ac/bdac7f99c098083596d0f8eeeb78f4ed.png
     * screenshot_pic : http://ctimg.5fun.com/upload/images/34/d5/34d5119f35508bbb2c16582455e1e7f2.jpg
     * down_url_remote : http://ctappdownload2018.5fun.com/appsite/simulator/android/xiangsuche0408_1.apk
     * game_package_name : com.blockycars.online.papa
     * game_down_status : 1
     * game_info : 海外精品游戏，国内唯一正版像素车！
     * game_ver_name : 1.1
     * game_ver : 103
     * game_plugin_num : 46
     * game_tag_info : [{"id":"2","name":"精品","color":"#72c9d6","type":"1"}]
     * game_open_switch : 0
     * game_open_time : 1522842180
     * game_size : 101.00
     * game_actual_size : 106459696
     * game_unzip_size : 106459696
     * game_comment_score_switch : 1
     * game_comment_score : 8.3
     * game_down_count : 254040
     */

    private String game_id;
    private String game_name;
    private String game_ico;
    private String game_screenshot_pic;
    private String game_down_load_url;
    private String game_package_name;
    private int game_down_status;
    private String game_info;
    private String game_ver_name;
    private int game_ver;
    private int game_startup_num=46;
    private String game_open_switch;
    private String game_open_time;
    private String game_size;
    private long game_actual_size;
    private long game_unzip_size;
    private String game_comment_score_switch;
    private String game_comment_score;
    private String game_achievement_title;
    private int game_down_count;
    private List<GameTagInfoBean> game_tag_info;
    private List<GameTagInfoBean> game_tag_info_v2;
    private DownLoadTaskTable taskTable;
    private long refreshTime;
    private String game_title;
    private String game_source;
    private GameScoreBean game_score;
    private String game_company_name;
    private IndexBeanV3Response.CreditInfoBean credit_info;

    public IndexBeanV3Response.CreditInfoBean getCredit_info() {
        return credit_info;
    }

    public void setCredit_info(IndexBeanV3Response.CreditInfoBean credit_info) {
        this.credit_info = credit_info;
    }

    public GameScoreBean getGame_score() {
        return game_score;
    }

    public void setGame_score(GameScoreBean game_score) {
        this.game_score = game_score;
    }

    public String getGame_company_name() {
        return game_company_name;
    }

    public void setGame_company_name(String game_company_name) {
        this.game_company_name = game_company_name;
    }

    public String getGame_source() {
        return game_source;
    }

    public void setGame_source(String game_source) {
        this.game_source = game_source;
    }

    private String syncTime;
    private List<GamePrizesBean> game_prizes;

    public List<GamePrizesBean> getGame_prizes() {
        return game_prizes;
    }

    public void setGame_prizes(List<GamePrizesBean> game_prizes) {
        this.game_prizes = game_prizes;
    }

    public String getSyncTime() {
        return syncTime;
    }

    public void setSyncTime(String syncTime) {
        this.syncTime = syncTime;
    }

    public List<GameTagInfoBean> getGame_tag_info_v2() {
        return game_tag_info_v2;
    }

    public void setGame_tag_info_v2(List<GameTagInfoBean> game_tag_info_v2) {
        this.game_tag_info_v2 = game_tag_info_v2;
    }

    public String getGame_title() {
        return game_title;
    }

    public void setGame_title(String game_title) {
        this.game_title = game_title;
    }

    public long getRefreshTime() {
        return refreshTime;
    }

    public void setRefreshTime(long refreshTime) {
        this.refreshTime = refreshTime;
    }

    public DownLoadTaskTable getDownloadTaskTableSimple() {
        DownLoadTaskTable taskTable = new DownLoadTaskTable();
        taskTable.setGameId(getGame_id());
        taskTable.setDownStatus(DownLoadStatusConfig.NORMAL);
        taskTable.setDownloadUrl(getGame_down_load_url());
        int game_plugin_num=getGame_startup_num();
        if (game_plugin_num == 46) {
            taskTable.setGameType(0);
        } else if (game_plugin_num == 47) {
            taskTable.setGameType(2);
        } else if (game_plugin_num == 48) {
            taskTable.setGameType(1);
        }
        taskTable.setPackageName(getGame_package_name());
        taskTable.setShowSize(game_size);
        taskTable.setUnzip_size(game_unzip_size);
        taskTable.setTotalSize(game_actual_size);
        taskTable.setGame_info(game_info);
        taskTable.setGame_down_count(game_down_count);
        Gson gson=new Gson();
        String json=gson.toJson(game_tag_info);
        taskTable.setGame_tag_info(json);
        taskTable.setGameName(game_name);
        taskTable.setGame_ico(game_ico);
        taskTable.setVer(game_ver);
        return taskTable;
    }

    public String getGame_achievement_title() {
        return game_achievement_title;
    }

    public void setGame_achievement_title(String game_achievement_title) {
        this.game_achievement_title = game_achievement_title;
    }

    public String getGame_id() {
        return game_id;
    }

    public void setGame_id(String game_id) {
        this.game_id = game_id;
    }

    public String getGame_name() {
        return game_name;
    }

    public void setGame_name(String game_name) {
        this.game_name = game_name;
    }

    public String getGame_ico() {
        return game_ico;
    }

    public void setGame_ico(String game_ico) {
        this.game_ico = game_ico;
    }

    public String getGame_screenshot_pic() {
        return game_screenshot_pic;
    }

    public void setGame_screenshot_pic(String game_screenshot_pic) {
        this.game_screenshot_pic = game_screenshot_pic;
    }

    public String getGame_down_load_url() {
        return game_down_load_url;
    }

    public void setGame_down_load_url(String game_down_load_url) {
        this.game_down_load_url = game_down_load_url;
    }

    public String getGame_package_name() {
        return game_package_name;
    }

    public void setGame_package_name(String game_package_name) {
        this.game_package_name = game_package_name;
    }

    public int getGame_down_status() {
        return game_down_status;
    }

    public void setGame_down_status(int game_down_status) {
        this.game_down_status = game_down_status;
    }

    public String getGame_info() {
        return game_info;
    }

    public void setGame_info(String game_info) {
        this.game_info = game_info;
    }

    public String getGame_ver_name() {
        return game_ver_name;
    }

    public void setGame_ver_name(String game_ver_name) {
        this.game_ver_name = game_ver_name;
    }

    public int getGame_ver() {
        return game_ver;
    }

    public void setGame_ver(int game_ver) {
        this.game_ver = game_ver;
    }

    public int getGame_startup_num() {
        return game_startup_num;
    }

    public void setGame_startup_num(int game_startup_num) {
        this.game_startup_num = game_startup_num;
    }

    public String getGame_open_switch() {
        return game_open_switch;
    }

    public void setGame_open_switch(String game_open_switch) {
        this.game_open_switch = game_open_switch;
    }

    public String getGame_open_time() {
        return game_open_time;
    }

    public void setGame_open_time(String game_open_time) {
        this.game_open_time = game_open_time;
    }

    public String getGame_size() {
        return game_size;
    }

    public void setGame_size(String game_size) {
        this.game_size = game_size;
    }

    public long getGame_actual_size() {
        return game_actual_size;
    }

    public void setGame_actual_size(long game_actual_size) {
        this.game_actual_size = game_actual_size;
    }

    public long getGame_unzip_size() {
        return game_unzip_size;
    }

    public void setGame_unzip_size(long game_unzip_size) {
        this.game_unzip_size = game_unzip_size;
    }

    public String getGame_comment_score_switch() {
        return game_comment_score_switch;
    }

    public void setGame_comment_score_switch(String game_comment_score_switch) {
        this.game_comment_score_switch = game_comment_score_switch;
    }

    public String getGame_comment_score() {
        return game_comment_score;
    }

    public void setGame_comment_score(String game_comment_score) {
        this.game_comment_score = game_comment_score;
    }

    public int getGame_down_count() {
        return game_down_count;
    }

    public void setGame_down_count(int game_down_count) {
        this.game_down_count = game_down_count;
    }

    public List<GameTagInfoBean> getGame_tag_info() {
        return game_tag_info;
    }

    public void setGame_tag_info(List<GameTagInfoBean> game_tag_info) {
        this.game_tag_info = game_tag_info;
    }

    public DownLoadTaskTable getTaskTable() {
        return taskTable;
    }

    public void setTaskTable(DownLoadTaskTable taskTable) {
        this.taskTable = taskTable;
    }

    public static class GameScoreBean implements Serializable {
        /**
         * score : 0
         * count : 0
         */

        private String score;
        private int count;

        public String getScore() {
            return score;
        }

        public void setScore(String score) {
            this.score = score;
        }

        public int getCount() {
            return count;
        }

        public void setCount(int count) {
            this.count = count;
        }
    }
}
